package com.xlabs.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.xlabs.client.DTO.QuestionDTO;
import com.xlabs.client.DTO.ReplyDTO;

import java.util.List;

/**
 * TimedCommentService class.
 */
@SuppressWarnings({"NonSerializableServiceParameters"})
@RemoteServiceRelativePath("com.xlabs.Geeky/com.xlabs.Geeky/CommentingService")
public interface CommentingService extends RemoteService {
    /**
     * Posts comment for a video.
     *
     * @param comment comment text.
     * @param time    time of comment.
     * @param currentVideoId video id.
     */
    public QuestionDTO[] postQuestion(String comment, int time, String currentVideoId);

    /**
     * Gets all comments for the given video.
     * @param currentVideoId video id.
     */
    public QuestionDTO[] getQuestions(String currentVideoId);

    /**
     * Posts a reply for a question.
     *
     * @param reply       reply.
     * @param questionKey question key.
     * @return updated comments.
     */
    public QuestionDTO[] postReply(String reply, String questionKey);

    /**
     * Gets the conversation related to the question given.
     *
     * @param questionEncodedKey question's key.
     * @return conversation.
     */
    public List<ReplyDTO> getConversation(String questionEncodedKey);

    /**
     * Posts an inner reply for another reply in conversation.
     *
     * @param reply              reply.
     * @param parentReplyKey     question key.
     * @param questionEncodedKey corresponding question's encoded key
     */
    public void posInnertReply(String reply, String parentReplyKey, String questionEncodedKey);
}